home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / rbbs_pc / mapl0831.zip / ANSIED.MRG < prev    next >
Text File  |  1992-08-31  |  40KB  |  1,186 lines

  1. * ------------[ BLED merge (c) Ken Goosens ]-------------
  2. * Merge this against E:\RBBS\STOCK\ANSIED.BAS to produce E:\RBBS\CHAT\ANSIED.BAS
  3. * E:\RBBS\STOCK\ANSIED.BAS:  Date 2-16-1991  Size 43992 bytes
  4. * ------------[ Created 08-31-1992 21:16:43 ]------------
  5. * REPLACING old line(s) by new
  6. * ------[ first line different ]------
  7. ' $linesize:132
  8. ' $title: 'ANSIED.BAS'
  9. '*
  10. '*  ANSIED v2.44a  by Tom Collins 
  11. '*---------------------------------------------------------------------------
  12. '*  Full Screen Text Editor for RBBS-PC
  13. '*  QuickBASIC v4.5 Version
  14. '*  02-16-91
  15. '*
  16. '*  v2.1xx ... made it work with RBBS v17
  17. '*  v2.2 ..... fixed some inconsistincies in the code as to # of lines in msg.
  18. '*             Some of the code thought 99 was length, some thought 100.
  19. '*  v2.3 ..... let it work with quoted reply.  No more REDIM of ZOutTxt$
  20. '*  v2.4 ..... removed tabs, margins code to be smaller
  21. '*  v2.41..... fixed bug with loss of bold attribute occasionally
  22. '*  v2.42..... made it work as a v17.3 subroutine.  Added block delete.
  23. '*  v2.43..... Added to: and from:.  Made cursor keys work locally.
  24. '*  v2.43a.... Stupid little bugs fixed
  25. '*  v2.44..... Fixed bugs, added ^T, Import, Subject, ASM functions
  26. '*  v2.44a.... Wordwrap/reflow bug fixed.  Arrows work in del.  Lines renum.
  27. '*
  28. '*  Returns:
  29. '*  ZSubParm  =  1 - Save Message
  30. '*            =  2 - Abort Message
  31. '*            = -1 - Dropped Carrier
  32. '*            = -2 - Sleep Disconnect
  33. '*
  34. '* Compile with:
  35. '*   BC C:\RBBSARCS\ANSIED.BAS /O/T/C:512;
  36. '*   
  37. '* Modifications to 2.44a by: Steve Stevens
  38. '* If you Like 'em let me know!
  39. '*       FIDONET 1:376/102                      RBBSNet 8:927/2
  40.  
  41.  
  42. * REPLACING old line(s) by new
  43. 110   CONST ESCKey = 27
  44.       CONST BackspKey = 8
  45.       CONST OtherBackspKey = 127
  46.       CONST CarrRet = 13
  47.       CONST WordLeftKey = 1          ' Ctrl-A
  48.       CONST ReformTextKey = 2        ' Ctrl-B
  49.       CONST PageDownKey = 3          ' Ctrl-C
  50.       CONST ColRightKey = 4          ' Ctrl-D
  51.       CONST LineUpKey = 5            ' Ctrl-E
  52.       CONST WordRightKey = 6         ' Ctrl-F
  53.       CONST CharDeleteKey = 7        ' Ctrl-G
  54. * ------[ first line different ]------
  55.       CONST HelpExpertKey = 8        ' Ctrl-H
  56.       CONST TabKey = 9               ' Ctrl-I <- Tab Key Support
  57.       CONST EndSessionKey = 11       ' Ctrl-K
  58.       CONST HelpKey = 14             ' Ctrl-N
  59.       CONST ReflowTextKey = 15       ' Ctrl-O
  60.       CONST RepaintKey = 16          ' Ctrl-P
  61.       CONST PageUpKey = 18           ' Ctrl-R
  62.       CONST ColLeftKey = 19          ' Ctrl-S
  63.       CONST DeleteWordRightKey = 20  ' Ctrl-T
  64.       CONST ToggleINSKey = 22        ' Ctrl-V
  65.       CONST HomeKey = 23             ' Ctrl-W
  66.       CONST LineDownKey = 24         ' Ctrl-X
  67.       CONST LineDeleteKey = 25       ' Ctrl-Y
  68.       CONST EndKey = 26              ' Ctrl-Z
  69.  
  70.       CONST BlankLine$ = ""
  71. * REPLACING old line(s) by new
  72. 120   COMMON SHARED /Ansied/ CurrentRow, CurrentCol, TopLine
  73.       COMMON SHARED /Ansied/ OldColour, IsBold, InsertMode
  74.       COMMON SHARED /Ansied/ SoftSpace$
  75.       COMMON SHARED /Ansied/ BlockDelActive, MsgLockLines
  76.       COMMON SHARED /Ansied/ BlockLine1, BlockLine2
  77.       COMMON SHARED /Ansied/ MsgTo$, MsgSubj$
  78.  
  79. * ------[ first line different ]------
  80. ' $INCLUDE: 'RBBS-VAR.MOD'
  81.  
  82. '      REDIM ZOutTxt$(99)     '<-- Needed to add this,
  83. '      REDIM ZUserIn$(10)      '<-- And this for some strange reason.
  84.  
  85. '*  AnsiEd
  86. '*----------------------------------------------------------------------------
  87. '*  Main full-screen editor routine
  88. '*
  89. '*
  90.       SUB Ansied (T$, S$, L%) STATIC
  91.       '*
  92.       '* ZworkAra$() holds what's currently on the user's screen.
  93.       '* 24 Lines: ZWorkAra$(1) = Menu, Bottom Line = "Line 25"
  94.       '*
  95.  
  96. * REPLACING old line(s) by new
  97. * ------[ first line different ]------
  98. 500  REDIM ZWorkAra$(24)
  99.       '*
  100.       '* TopLine is the index into the ZOutTxt$() array that
  101.       '* corresponds to the top of the displayed image, i.e.
  102.       '* what's on line 3 of the user's screen.
  103.       '*
  104.       '*   1,12,23,34,45,56,78
  105.       '*
  106.       TopLine = 1
  107.       SoftSpace$ = CHR$(250)
  108.       InsertMode = ZTrue
  109.       ZLineFeed$ = CHR$(10)
  110.       BlockDelActive = ZFalse
  111.       HiLiteSave = ZHiLiteOff
  112.       ZHiLiteOff = ZFalse
  113.       UseTputSave = ZUseTput
  114.       ZUseTput = ZFalse
  115.       MsgLockLines = L%
  116.       MsgTo$ = T$
  117.       CALL NameCaps(MsgTo$)
  118.  
  119.       MsgSubj$ = S$
  120.       YY$ = ""
  121.       IF LEFT$(MsgSubj$, 3) = "(R)" THEN
  122.          YY$ = "(R)"
  123.          MsgSubj$ = MID$(MsgSubj$, 4)
  124.       END IF
  125.       CALL NameCaps(MsgSubj$)
  126.       MsgSubj$ = YY$ + MsgSubj$
  127.  
  128.       '*
  129.       '* Initialize the screen
  130.       '*
  131. * REPLACING old line(s) by new
  132. 510   CALL ClearScreen
  133.       CALL UpdateStatusLine(1)
  134. * ------[ first line different ]------
  135.       CALL DisplayKeys
  136.       CALL MoveCursor(3, 1)
  137.       '*
  138.       '* Remove ANSI sequences from the quoted lines
  139.       '*
  140.       IF ZLinesInMsg > 88 THEN
  141.          ZLinesInMsg = 88
  142.       END IF
  143.       IF ZMaxMsgLines > 98 THEN
  144.          ZMaxMsgLines = 98
  145.       END IF
  146.       IF ZLinesInMsg > ZMaxMsgLines THEN
  147.          ZLinesInMsg = ZMaxMsgLines
  148.       END IF
  149.       FOR I = ZLinesInMsg + 1 TO 99
  150.          ZOutTxt$(I) = BlankLine$
  151.       NEXT
  152.       IF ZLinesInMsg <> 0 THEN
  153.          FOR I = 1 TO ZLinesInMsg
  154.             CALL UnString(ZOutTxt$(I), "")
  155.          NEXT
  156.          J = ZLinesInMsg \ 11
  157.          IF ZLinesInMsg MOD 11 = 0 THEN
  158.            J = J - 1
  159.          END IF
  160.          TopLine = J * 11 + 1
  161.          J = ZLinesInMsg - TopLine
  162.          CALL MoveCursor(J + 5, 1)
  163.       END IF
  164.       CALL UpdateScreen
  165.       '*
  166.       '* Run the Editor
  167.       '*
  168. * REPLACING old line(s) by new
  169. 540            CASE ESCKey
  170.                   IF BlockDelActive THEN
  171.                      BlockDelActive = ZFalse
  172. * ------[ first line different ]------
  173.                      CALL ClearScreen        ' <-- Added when user cancells
  174.                      CALL UpdateScreen       ' Block Delete the "highlighted"
  175.                      CALL UpdateStatusLine(1)
  176.                      CALL UpdateStatusLine(2)
  177.                      CALL MoveCursor(BlockRow, BlockCol)
  178.                      KeyPressed = 255
  179.                   END IF
  180.  
  181.                CASE LineUpKey, LineDownKey, PageDownKey, PageUpKey, TabKey
  182.                   '*
  183.                   '* Up and Down get passed on
  184.                   '*
  185.                CASE ELSE
  186.                   '*
  187.                   '* Ignore the key
  188.                   '*
  189.                   KeyPressed = 255
  190.  
  191.             END SELECT
  192.          END IF
  193.  
  194. * REPLACING old line(s) by new
  195. 560      SELECT CASE KeyPressed
  196. * ------[ first line different ]------
  197.             CASE ESCKey,EndSessionKey    'Pe 03/17/92
  198.                '*
  199.                '* User wants to see main menu
  200.                '*
  201.                CALL DisplayMainMenu
  202.                CALL MoveCursor(RowSave, ColSave)
  203.                CALL GetChar(B$): GOSUB 740
  204.                CALL AllCaps(B$)                                        'RT062992
  205.                IF B$ = "D" THEN
  206.                   BlockDelActive = ZTrue
  207.                   BlockLine1 = RowSave + TopLine - 3
  208.                   BlockCol = ColSave
  209.                   BlockRow = RowSave
  210.                   CALL EraseToEOL(1, 1)
  211.                   ' v2.44a
  212.                   CALL PutScreen("Delete Block: Press ENTER on Last Line to Delete, or ESC Twice to Quit", DefaultColor, DefaultBold)
  213.                   BlockLine2 = 0
  214.   CALL MoveCursor(RowSave, 1)                                'SM070501
  215.    Index = (RowSave) + (Topline - 3)
  216.     CALL Putscreen(ZOutTxt$(Index),RedFore,ZFalse)
  217.                ELSE
  218.                   CALL MenuCommand(B$): GOSUB 740
  219.                END IF
  220.      CALL MoveCursor(RowSave, ColSave)
  221.  
  222. * REPLACING old line(s) by new
  223. 570         CASE LineUpKey
  224.                '*
  225.                '* Move the current cursor position up one line
  226.                '*
  227.                IF CurrentRow > 3 THEN
  228.                   CALL MoveCursor(CurrentRow - 1, CurrentCol)
  229.                ELSE
  230.                   IF TopLine <> 1 THEN
  231.                      TopLine = TopLine - 11
  232.                      CALL MoveCursor(CurrentRow + 10, CurrentCol)
  233.                      CALL UpdateScreen
  234.                   END IF
  235.                END IF
  236. * ------[ first line different ]------
  237. '*
  238. '* Un-Highlights lines to be deleted
  239. '* Steve
  240. IF BlockDelActive THEN
  241. ' CALL SaveCursor(SaveRow, SaveCol)
  242.   Index = (CurrentRow + 1) + (Topline - 3)
  243.     CALL MoveCursor(CurrentRow,1)                            'SM070501
  244.     CALL Putscreen(ZOutTxt$(Index), YellowFore,ZTrue)
  245.      CALL MoveCursor(SaveRow, SaveCol)
  246. END IF
  247.  
  248. * REPLACING old line(s) by new
  249. 580         CASE LineDownKey
  250.                '*
  251.                '* Move the current cursor position down one line
  252.                '*
  253. * ------[ first line different ]------
  254.                IF CurrentRow < 19 THEN
  255.                   CALL MoveCursor(CurrentRow + 1, CurrentCol)
  256.                ELSEIF BlockDelActive THEN
  257.                 CALL PutScreen(CHR$(7),RedFore,ZFalse)
  258.                ELSE
  259.                   IF NOT TopLine = 78 THEN
  260.                      TopLine = TopLine + 11
  261.                      CALL MoveCursor(CurrentRow - 10, CurrentCol)
  262.                      CALL UpdateScreen
  263.                   END IF
  264.                END IF
  265. '*
  266. '* Highlight lines to be delete
  267. '*        Steve
  268. IF BlockDelActive THEN
  269.    Index = (CurrentRow) + (Topline - 3)
  270.       CALL Putscreen(ZOutTxt$(Index),RedFore,ZFalse)
  271.        CALL MoveCursor(CurrentRow, 1)
  272. END IF
  273. * INSERTING new line(s)
  274. 595         CASE TabKey    ' <- Tab Key Support here..
  275.                '*
  276.                '* Tab 8 Spaces
  277.                '*
  278.                IF CurrentCol < 72 THEN
  279.                 CALL MoveCursor(CurrentRow, CurrentCol + 8)
  280.                END IF
  281.  
  282. * REPLACING old line(s) by new
  283. 710         CASE HelpKey, ReformTextKey, ReflowTextKey, ToggleINSKey, RepaintKey
  284.                '*
  285.                '* Execute a main menu command
  286.                '*
  287.                '*          1234567890123456789012
  288.                YY$ = MID$(" J           HRP     I", KeyPressed, 1)
  289.                CALL MenuCommand(YY$): GOSUB 740
  290.                CALL MoveCursor(RowSave, ColSave)
  291. * ------[ first line different ]------
  292.             CASE IS > 127, IS < 32
  293.                '*
  294.                '* Ignore characters above 127 or below 32
  295.                '*
  296. * REPLACING old line(s) by new
  297. 730   REDIM ZWorkAra$(13)
  298.       ZHiLiteOff = HiLiteSave
  299.       ZUseTput = UseTputSave
  300. * ------[ first line different ]------
  301.       S$ = MsgSubj$                                                   'RT062992
  302.       CALL AllCaps(S$)                                                'RT062992
  303.       EXIT SUB
  304.  
  305.       '*
  306.       '* Test ZSubParm and Exit ANSIED if the carrier dropped
  307.       '*
  308. * REPLACING old line(s) by new
  309. 740   IF ZSubParm <> 0 THEN
  310.          GOTO 730
  311.       END IF
  312.       RETURN
  313.  
  314.       END SUB         ' Sub AnsiEd
  315.  
  316. '*  BackspChar()
  317. '*----------------------------------------------------------------------------
  318. '*  This routine handles the user entering the backspace key
  319. '*
  320. '*
  321. * ------[ first line different ]------
  322.       SUB BackspChar STATIC
  323. * REPLACING old line(s) by new
  324. 1230     ELSE
  325.             CALL FindWrap(LEFT$(ZOutTxt$(Index - 1), ZRightMargin + 1), I)
  326.             IF I <= 1 THEN
  327.                I = ZRightMargin
  328.             END IF
  329.             ZOutTxt$(Index) = MID$(ZOutTxt$(Index - 1), I + 1)
  330.             ZOutTxt$(Index - 1) = LEFT$(ZOutTxt$(Index - 1), I)
  331.          END IF
  332.          IF RowSave > 3 THEN
  333.             CALL MoveCursor(RowSave - 1, NewCol)
  334.             CALL UpdateScreen
  335.          ELSE
  336.             CALL MoveCursor(RowSave, NewCol)
  337.             CALL UnGetChar(LineUpKey)
  338.          END IF
  339.       END IF
  340.       END SUB
  341.  
  342. '*  CarrRetKey()
  343. '*----------------------------------------------------------------------------
  344. '*  This routine handles carriage returns entered in the file
  345. '*
  346. '*
  347. * ------[ first line different ]------
  348.       SUB CarrRetKey STATIC
  349. * REPLACING old line(s) by new
  350. 1300  Index = CurrentRow + TopLine - 3
  351.       IF Index >= 99 THEN
  352.          EXIT SUB
  353.       END IF
  354.       IF InsertMode THEN         ' Insert a new line
  355.          FOR I = 98 TO Index + 1 STEP -1
  356.             ZOutTxt$(I + 1) = ZOutTxt$(I)
  357.          NEXT I
  358.          IF LEN(ZOutTxt$(Index)) >= CurrentCol THEN
  359.             ZOutTxt$(Index + 1) = MID$(ZOutTxt$(Index), CurrentCol)
  360.             ZOutTxt$(Index) = LEFT$(ZOutTxt$(Index), CurrentCol - 1)
  361.          ELSE
  362.             ZOutTxt$(Index + 1) = BlankLine$
  363.          END IF
  364.          CALL UpdateScreen
  365. * ------[ first line different ]------
  366. END IF
  367.  
  368.      IF CurrentRow < 19 THEN
  369.         CALL MoveCursor(CurrentRow + 1, 1)
  370.      ELSE
  371.          CALL MoveCursor(CurrentRow,1)
  372.          CALL UnGetChar(LineDownKey)
  373.      END IF
  374.       END SUB
  375.  
  376. '*  ChangeSubject()
  377. '*----------------------------------------------------------------------------
  378. '*  Routine to allow user to change the message subject
  379. '*
  380. '*
  381.       SUB ChangeSubject STATIC
  382.       CALL GetString("Change Subject From '" + MsgSubj$ + "' To? ", NewSubj$)
  383.       IF NewSubj$ <> "" THEN
  384.          MsgSubj$ = LEFT$(NewSubj$, 25)
  385.          CALL NameCaps(MsgSubj$)
  386.       END IF
  387.       END SUB
  388.  
  389. '*  ClearScreen()
  390. '*----------------------------------------------------------------------------
  391. '*  This routine clears the screen and moves the cursor to row 2, col 1
  392. '*
  393. '*
  394.       SUB ClearScreen STATIC
  395. * REPLACING old line(s) by new
  396. * ------[ first line different ]------
  397. 1500  FOR I = 1 TO 19
  398.          ZWorkAra$(I) = BlankLine$
  399.       NEXT I
  400.       CALL QuickTput("", 0)
  401.       ZSubParm = 2
  402.       CALL Line25
  403.       ZSubParm = 0
  404.       CALL QuickTput("H" + ZEmphasizeOff$, 0)
  405.       CurrentCol = 1
  406.       CurrentRow = 4
  407.       IsBold = DefaultBold
  408.       OldColour = DefaultColor
  409.       END SUB
  410.  
  411. '*  DeleteCurrentLine()
  412. '*----------------------------------------------------------------------------
  413. '*  This routine deletes the current line on the screen and in the array
  414. '*  ZOutTxt$, and moves the next lower line up one  It then repaints the
  415. '*  affected portion of the screen (from the deleted line down)
  416. '*
  417. '*
  418.       SUB DeleteCurrentLine (Index%) STATIC
  419. * REPLACING old line(s) by new
  420. 1600  FOR I = Index% TO 98
  421.          ZOutTxt$(I) = ZOutTxt$(I + 1)
  422.       NEXT I
  423.       ZOutTxt$(99) = BlankLine$
  424.       CALL UpdateScreen
  425.       END SUB
  426.  
  427. '*  DisplayMainMenu()
  428. '*----------------------------------------------------------------------------
  429. '*  This routine displays the main menu on the top line
  430. '*
  431. '*
  432. * ------[ first line different ]------
  433.       SUB DisplayMainMenu STATIC
  434. * REPLACING old line(s) by new
  435. 1700  CALL MoveCursor(1, 1)
  436.       YY$ = "A)bort H)elp D)elete I)ns/ovw J)ustify "
  437.       IF ZLocalUser OR ZSysop THEN
  438.          YY$ = YY$ + "O)import R)eflow P)aint S)ave U)subject "
  439.       ELSE
  440.          YY$ = YY$ + "R)eflow P)aint S)ave U)subject          "
  441.       END IF
  442.       CALL ColorPrompt(YY$)
  443.       CALL PutScreen(YY$, DefaultColor, DefaultBold)
  444.       END SUB
  445.  
  446. '*  DoneWithMsg()
  447. '*----------------------------------------------------------------------------
  448. '*  This routine is called to save or abort the message
  449. '*
  450. '*
  451. * ------[ first line different ]------
  452.       SUB DoneWithMsg (YY$) STATIC
  453. * REPLACING old line(s) by new
  454. 1810  SELECT CASE YY$
  455.          CASE "S"        ' Save Message
  456.             '*
  457.             '* Remove trailing blank lines from the message
  458.             '*
  459.             CALL FindEndOfMsg(EndOfMsg)
  460.             FOR I = 1 TO EndOfMsg
  461.                J = INSTR(ZOutTxt$(I), SoftSpace$)
  462.                WHILE J <> 0
  463.                   MID$(ZOutTxt$(I), J, 1) = " "
  464.                   J = INSTR(ZOutTxt$(I), SoftSpace$)
  465.                WEND
  466.                CALL TrimTrail(ZOutTxt$(I), " ")
  467.             NEXT I
  468.             CALL FindEndOfMsg(ZLinesInMsg)
  469. * ------[ first line different ]------
  470.              CALL EraseToEOL(1, 1)
  471.               CALL MoveCursor(1, 1)
  472.       CALL PutScreen(" ", DefaultColor, DefaultBold)
  473.       CALL ClearScreen                 'Pe 03/15/92
  474.                ZSubParm = 1
  475.  
  476. * REPLACING old line(s) by new
  477. 1820     CASE "A"
  478.             CALL EraseToEOL(1, 1)
  479.             YY$ = "Abort: Are You Sure (Y)es,[N]o)? "
  480.             CALL ColorPrompt(YY$)
  481.             CALL PutScreen(YY$, DefaultColor, DefaultBold)
  482.             CALL GetChar(B$)
  483.             IF ZSubParm <> 0 THEN
  484.                B$ = "Y"
  485.             END IF
  486. * ------[ first line different ]------
  487.             CALL AllCaps(B$)                                           'RT062992
  488.             IF B$ = "Y" THEN                                           'RT062992
  489.                CALL ClearScreen
  490.                ZSubParm = 2
  491.             END IF
  492.  
  493.       CASE ELSE
  494.  
  495.       END SELECT
  496.       END SUB
  497.  
  498. '*  EraseToEOL()
  499. '*----------------------------------------------------------------------------
  500. '*  This routine clears from a position to to the end of that line
  501. '*
  502. '*
  503.       SUB EraseToEOL (LineNumber, ColNumber) STATIC
  504. * REPLACING old line(s) by new
  505. 1900  CALL MoveCursor(LineNumber, ColNumber)
  506.       CALL QuickTput("", 0)
  507.       END SUB
  508.  
  509. '*  FindEndOfMsg()
  510. '*----------------------------------------------------------------------------
  511. '*  Finds the last active line in the message
  512. '*
  513. '*
  514. * ------[ first line different ]------
  515.       SUB FindEndOfMsg (EndOfMsg) STATIC
  516.       EndOfMsg = 1
  517.       FOR I = ZMaxMsgLines TO 1 STEP -1
  518.          IF ZOutTxt$(I) <> BlankLine$ OR I <= MsgLockLines THEN
  519.             EndOfMsg = I
  520.             EXIT FOR
  521.          END IF
  522.       NEXT I
  523.       END SUB
  524.  
  525. '*  FindWrap()
  526. '*----------------------------------------------------------------------------
  527. '*  This routine finds a place in the string yy$ that could be used as a
  528. '*  place to wrap the line WhereToWrap should be the last position that
  529. '*  remains in the line, ie
  530. '*    set   currentline$ = left$(yy$,wheretowrap)
  531. '*          nextline$    = mid$ (yy$,wheretowrap+1)
  532. '*
  533. '*
  534.       SUB FindWrap (YY$, WhereToWrap) STATIC
  535. * REPLACING old line(s) by new
  536. 2100  WhereToWrap = LEN(YY$) + 1
  537.       CALL FindWord(YY$, 0, WhereToWrap)
  538.       WhereToWrap = WhereToWrap - 1
  539.       END SUB
  540.  
  541. '*  GetChar()
  542. '*----------------------------------------------------------------------------
  543. '*  This routine reads a character from the user into YY$
  544. '*
  545. '*
  546. * ------[ first line different ]------
  547.       SUB GetChar (YY$) STATIC
  548. * REPLACING old line(s) by new
  549. 2200  ZAutoLogoff! = TIMER + ZWaitBeforeDisconnect
  550.       CALL Carrier
  551.       YY$ = ""
  552.       WHILE ZSubParm <> -1 AND ZSubParm <> -2 AND YY$ = ""
  553.          ZSubParm = 0
  554.          IF LEN(ZCommportStack$) > 0 THEN
  555.             YY$ = LEFT$(ZCommportStack$, 1)
  556.             ZCommportStack$ = MID$(ZCommportStack$, 2)
  557.          ELSE
  558.             IF ZLocalUser THEN
  559.                YY$ = INKEY$
  560.                IF LEN(YY$) = 2 THEN
  561.                   KeyPressed = ASC(RIGHT$(YY$, 1))
  562.                   YY$ = ""
  563.                   SELECT CASE KeyPressed
  564.                      CASE 82                  ' Insert
  565.                         KeyPressed = ToggleINSKey
  566.                      CASE 83                  ' Delete
  567.                         KeyPressed = CharDeleteKey
  568.                      CASE 71                  ' Home
  569.                         KeyPressed = HomeKey
  570.                      CASE 73                  ' PgUp
  571.                         KeyPressed = PageUpKey
  572.                      CASE 72                  ' Up Arrow
  573.                         KeyPressed = LineUpKey
  574.                      CASE 80                  ' Down Arrow
  575.                         KeyPressed = LineDownKey
  576.                      CASE 81                  ' PgDn
  577.                         KeyPressed = PageDownKey
  578.                      CASE 75                  ' Left Arrow
  579.                         KeyPressed = ColLeftKey
  580.                      CASE 77                  ' Right Arrow
  581.                         KeyPressed = ColRightKey
  582.                      CASE 115                 ' Ctrl-Left Arrow
  583.                         KeyPressed = WordLeftKey
  584.                      CASE 116                 ' Ctrl-Right Arrow
  585.                         KeyPressed = WordRightKey
  586.                      CASE 79                  ' End
  587.                         KeyPressed = EndKey
  588. * ------[ first line different ]------
  589.                      CASE 9
  590.                         KeyPressed = TabKey
  591.                      CASE ELSE
  592.                         KeyPressed = 0
  593.                   END SELECT
  594.                   IF KeyPressed <> 0 THEN
  595.                      YY$ = CHR$(KeyPressed)
  596.                   END IF
  597.                END IF
  598.             ELSE
  599.                CALL FindFKey
  600.                IF ZSubParm >= 0 THEN
  601.                   YY$ = ZKeyPressed$
  602.                   IF YY$ = "" THEN
  603.                      CALL EofComm(Char%)
  604.                      IF Char% = -1 THEN
  605.                         CALL CheckTime(ZAutoLogoff!, Remain!, 1)
  606.                         IF Remain! < 0 THEN
  607.                            CALL UpdtCalr("Sleep disconnect", 1)
  608.                            ZSubParm = -2
  609.                            ZNo = ZTrue
  610.                            ZSleepDisconnect = ZTrue
  611.                         END IF
  612.                      ELSE
  613.                         CALL Carrier
  614.                         IF ZSubParm <> -1 THEN
  615.                            ZSubParm = 0
  616.                            CALL GetCom(YY$)
  617.                         END IF
  618.                      END IF
  619.                   END IF
  620.                END IF
  621.             END IF
  622.          END IF
  623.       WEND
  624.       END SUB
  625.  
  626. '*  GetString()
  627. '*----------------------------------------------------------------------------
  628. '*  Gets a string from the user
  629. '*
  630. '*
  631.       SUB GetString (Prompt$, YY$) STATIC
  632.       YY$ = ""
  633.       CALL EraseToEOL(1, 1)
  634.       CALL PutScreen(Prompt$, DefaultColor, DefaultBold)
  635.       NewCol = CurrentCol
  636.       InitCol = NewCol
  637.       DO
  638.          CALL MoveCursor(CurrentRow, NewCol)
  639.          CALL GetChar(B$)
  640.          IF ZSubParm <> 0 THEN
  641.             B$ = CHR$(ESCKey)
  642.          END IF
  643.          KeyPressed = ASC(B$)
  644.          SELECT CASE KeyPressed
  645.             CASE BackspKey, OtherBackspKey
  646.                IF NewCol <> InitCol THEN
  647.                   CALL MoveCursor(CurrentRow, NewCol - 1)
  648.                   CALL PutScreen(" ", DefaultColor, DefaultBold)
  649.                   NewCol = NewCol - 1
  650.                   YY$ = LEFT$(YY$, LEN(YY$) - 1)
  651.                END IF
  652.             CASE CarrRet
  653.                EXIT DO
  654.             CASE ESCKey
  655.                YY$ = ""
  656.                EXIT DO
  657.             CASE ELSE
  658.                YY$ = YY$ + B$
  659.                CALL PutScreen(B$, DefaultColor, DefaultBold)
  660.                NewCol = NewCol + 1
  661.          END SELECT
  662.       LOOP WHILE 1
  663.       END SUB
  664.  
  665. '*  HelpMe()
  666. '*----------------------------------------------------------------------------
  667. '*  This routine provides on-line help for the user
  668. '*
  669. '*
  670.       SUB HelpMe STATIC
  671. * REPLACING old line(s) by new
  672. 2300  CALL SaveCursor(RowSave, ColSave)
  673.       CALL ClearScreen
  674.       CALL BufFile(ZHelpPath$ + "ANSIED" + ZHelpExtension$, X)
  675.       CALL ClearScreen
  676.       CALL UpdateScreen
  677.       CALL MoveCursor(RowSave, ColSave)
  678.       END SUB
  679.  
  680. '*  ImportFile()
  681. '*----------------------------------------------------------------------------
  682. '*  Imports an ASCII text file in the message
  683. '*
  684. '*
  685. * ------[ first line different ]------
  686.       SUB ImportFile STATIC
  687.       IF ZLocalUser OR ZSysop THEN
  688.          CALL GetString("Import What File? ", FileName$)
  689.          IF FileName$ <> "" THEN
  690.             CALL FindIt(FileName$)
  691.             IF ZOK THEN
  692.                ZUserIn$(1) = FileName$
  693.                ZAnsIndex = 0
  694.                ZLastIndex = 1
  695.                CALL FindEndOfMsg(EndOfMsg)
  696.                CALL MsgImport(ZMaxMsgLines, ZRightMargin, EndOfMsg, ZOutTxt$())
  697.          J = EndOfMsg \ 11
  698.          IF EndOfMsg MOD 11 = 0 THEN
  699.            J = J - 1
  700.          END IF
  701.           TopLine = J * 11 + 1
  702.            J = EndOfMsg - TopLine
  703.           CALL MoveCursor(J + 5, 1)
  704.          CALL UpdateScreen
  705.             END IF
  706.          END IF
  707.       END IF
  708.       END SUB
  709.  
  710. '*  LastParaLine()
  711. '*----------------------------------------------------------------------------
  712. '*  This routine returns ZTrue if ZOutTxt$(I) is the last line
  713. '*  in a paragraph
  714. '*
  715. '*
  716.       SUB LastParaLine (I, LastLine, Result) STATIC
  717. * REPLACING old line(s) by new
  718. 2400  Result = ZFalse
  719.       IF I = LastLine OR I >= ZMaxMsgLines THEN
  720.          Result = ZTrue
  721.       ELSE
  722.          YY$ = ZOutTxt$(I)
  723.          J = INSTR(YY$, ">")
  724.          IF J = 0 THEN
  725.             J = 6
  726.          END IF
  727.          IF J < 5 THEN
  728.             Result = ZTrue
  729.          ELSEIF YY$ = BlankLine$ THEN
  730.             Result = ZTrue
  731.          ELSE
  732.             IF ZOutTxt$(I + 1) = BlankLine$ THEN
  733.                Result = ZTrue
  734.             ELSEIF LEFT$(ZOutTxt$(I + 1), 1) = " " THEN
  735.                Result = ZTrue
  736.             ELSE
  737.                K = INSTR(ZOutTxt$(I + 1), ">")
  738.                IF K <> 0 AND K < 5 THEN
  739.                   Result = ZTrue
  740.                END IF
  741.             END IF
  742.          END IF
  743.       END IF
  744.       END SUB
  745.  
  746. '*  MenuCommand()
  747. '*----------------------------------------------------------------------------
  748. '* This routine executes the passed main menu command
  749. '*
  750. '*
  751. * ------[ first line different ]------
  752.       SUB MenuCommand (YY$) STATIC
  753. * REPLACING old line(s) by new
  754. 2450  ZSubParm = 0              ' v2.44a
  755.       SELECT CASE YY$
  756. * ------[ first line different ]------
  757. '         CASE "+"
  758. '         CASE "-"
  759.          CASE "H"
  760.             CALL HelpMe
  761.             CALL DisPlayKeys       'Pe 03/17/92
  762.          CASE "S", "A"
  763.             CALL DoneWithMsg(YY$)
  764.          CASE "P"
  765.             CALL ClearScreen
  766.             CALL DisplayKeys
  767.             CALL UpdateScreen
  768.          CASE "I"
  769.             InsertMode = NOT InsertMode
  770.          CASE "R"
  771.             CALL ReformText(ZFalse)
  772.          CASE "J"
  773.             CALL ReformText(ZTrue)
  774.          CASE "O"
  775.             CALL ImportFile
  776.          CASE "U"
  777.             CALL ChangeSubject
  778.       Case Else                       'HP072501
  779.       END SELECT
  780.       IF ZSubParm = 0 THEN
  781.          CALL EraseToEOL(1, 1)
  782.          CALL UpdateStatusLine(1)
  783.       END IF
  784.       END SUB
  785.  
  786. '*  MoveCursor()
  787. '*----------------------------------------------------------------------------
  788. '*  This routine moves the cursor to the position spec'd by newcol and
  789. '*  newrow and tries to do it with the minimum number of Ansi characters
  790. '*
  791. '*
  792.       SUB MoveCursor (NewRow, NewCol) STATIC
  793. * REPLACING old line(s) by new
  794. 2500  YY$ = "        "
  795.       CALL MoveCurStr(CurrentRow, CurrentCol, NewRow, NewCol, YY$, YLen)
  796.       IF YLen <> 0 THEN
  797.          YY$ = LEFT$(YY$, YLen)
  798.          CALL QuickTput(YY$, 0)
  799.       END IF
  800.       ZSubParm = 0
  801.       END SUB
  802.  
  803. '*  NormalChar()
  804. '*----------------------------------------------------------------------------
  805. '*  This routine handles 'normal' characters entered into the message
  806. '*
  807. '*
  808. * ------[ first line different ]------
  809.       SUB NormalChar (YY$) STATIC
  810.  
  811. * REPLACING old line(s) by new
  812. 2630  ELSE
  813.          '*
  814.          '* Wrap the end of the line
  815.          '*
  816.          IF NOT AtEndOfLine THEN
  817.             ZOutTxt$(Index) = LEFT$(ZOutTxt$(Index), CurrentCol - 1) + YY$ + MID$(ZOutTxt$(Index), CurrentCol)
  818.             LML = LML + 1
  819.          ELSE
  820.             MID$(ZOutTxt$(Index), CurrentCol, 1) = YY$
  821.          END IF
  822.  
  823.          CALL FindWrap(ZOutTxt$(Index), I)
  824.          IF I <= 1 THEN
  825.             I = ZRightMargin
  826.          END IF
  827.  
  828.          ZZ$ = MID$(ZOutTxt$(Index), (I + 1))
  829.          CALL TrimTrail(ZZ$, SoftSpace$)
  830.          ZOutTxt$(Index) = LEFT$(ZOutTxt$(Index), I)
  831.          '*
  832.          '* Add to the beginning of a new line
  833.          '*
  834.          IF Index <= 98 THEN
  835.             Index = Index + 1
  836.          END IF
  837.  
  838.          Z = INSTR(ZOutTxt$(Index), ">")                                                  ' v2.44a
  839.          IF ZOutTxt$(Index) <> BlankLine$ AND (Z <= 0 OR Z > 6) AND LEN(ZOutTxt$(Index)) + LEN(ZZ$) < ZRightMargin THEN
  840.             ZOutTxt$(Index) = ZZ$ + ZOutTxt$(Index)
  841.          ELSE
  842.             FOR J = 98 TO Index STEP -1
  843.                ZOutTxt$(J + 1) = ZOutTxt$(J)
  844.             NEXT J
  845.             ZOutTxt$(Index) = ZZ$
  846.          END IF
  847.  
  848.          CALL EraseToEOL(CurrentRow, I + 1)        ' do the "easy" line
  849.          ZWorkAra$(CurrentRow) = ZOutTxt$(Index)
  850.  
  851.          CALL UpdateScreen
  852.          IF (ColSave > I) THEN
  853.             NewCol = ColSave - I + 1
  854. * ------[ first line different ]------
  855.             IF RowSave <> 19 THEN
  856.                CALL MoveCursor(RowSave + 1, NewCol)
  857.             ELSE
  858.                CALL MoveCursor(RowSave, NewCol)
  859.                CALL UnGetChar(LineDownKey)
  860.             END IF
  861.          ELSE
  862.             CALL MoveCursor(RowSave, ColSave + 1)
  863.          END IF
  864.       END IF
  865.       END SUB
  866.  
  867. '*  PutScreen()
  868. '*----------------------------------------------------------------------------
  869. '* This routine writes YY$ to the user in the color and
  870. '* intensity specified
  871. '*
  872. '*
  873.       SUB PutScreen (YY$, Colour, Bold) STATIC
  874. * REPLACING old line(s) by new
  875. 2800  ZZ$ = ""
  876.       IF Colour <> 99 THEN
  877.          IF (Colour <> OldColour) OR (Bold <> IsBold) THEN
  878.             ZZ$ = ""
  879.             IF Bold <> IsBold THEN
  880.                IF Bold THEN
  881.                   ZZ$ = ZZ$ + "1;"
  882.                ELSE
  883.                   ZZ$ = ZZ$ + "0;"
  884.                END IF
  885.             END IF
  886.             ZZ$ = ZZ$ + MID$(STR$(Colour), 2) + "m"
  887.          END IF
  888.       ELSE
  889.          ZZ$ = ZEmphasizeOff$
  890.       END IF
  891.       ZOutTxt$ = ZZ$ + YY$
  892.       IF ZLocalUser THEN
  893.          CALL QuickTput(ZOutTxt$, 0)
  894.       ELSE
  895.          ZSubParm = 4
  896.          CALL Tput
  897.       END IF
  898.       ZSubParm = 0
  899.       IF INSTR(YY$, "") = 0 THEN
  900.          CurrentCol = CurrentCol + LEN(YY$)
  901.          IF CurrentCol > 80 THEN
  902.             CurrentCol = 0
  903.             CurrentRow = 0
  904.          END IF
  905.       ELSE
  906.          CurrentRow = 0
  907.          CurrentCol = 0
  908.       END IF
  909.       OldColour = Colour
  910.       IsBold = Bold
  911.       END SUB
  912.  
  913. '*  ReformText()
  914. '*----------------------------------------------------------------------------
  915. '*  This routine reflows the text to the current margins.  Optionally,
  916. '*  it right justifies all lines by adding "soft spaces"
  917. '*
  918. '*
  919. * ------[ first line different ]------
  920.       SUB ReformText (Justify%) STATIC
  921.  
  922. * REPLACING old line(s) by new
  923. 2900  DIM Places(80)
  924.  
  925.       CALL EraseToEOL(1, 1)
  926.       CALL PutScreen("Reformatting... Please Wait.", WhiteFore, ZTrue)
  927.  
  928.       CALL FindEndOfMsg(EndOfMsg)
  929.  
  930.       I = MsgLockLines + 1   ' Read index
  931.       J = MsgLockLines + 1   ' Write index
  932.  
  933.       '*
  934.       '* Reflow the text to the maximum on a line
  935.       '*
  936.       DO WHILE I <= EndOfMsg
  937.          '*
  938.          '* Loop until we get a long line or an end of paragraph
  939.          '*
  940.          ZOutTxt$ = ""
  941.          DO WHILE 1
  942.             YY$ = ZOutTxt$(I)
  943.             CALL UnString(YY$, SoftSpace$)
  944.             IF ZOutTxt$ <> "" AND RIGHT$(ZOutTxt$, 1) <> " " THEN
  945.                ZOutTxt$ = ZOutTxt$ + " "
  946.             END IF
  947.             ZOutTxt$ = ZOutTxt$ + YY$
  948.             CALL LastParaLine(I, EndOfMsg, EndOfPara)
  949.             I = I + 1
  950.             IF LEN(ZOutTxt$) > ZRightMargin THEN
  951.                '*
  952.                '* Wrap the long line
  953.                '*
  954.                CALL FindWrap(LEFT$(ZOutTxt$, ZRightMargin + 1), K)
  955.                IF K <= 1 THEN
  956.                   K = ZRightMargin
  957.                END IF
  958.                ZOutTxt$(J) = LEFT$(ZOutTxt$, K)
  959.                IF EndOfPara THEN
  960.                   '*
  961.                   '* Go to the next paragraph
  962.                   '*
  963.                   J = J + 1
  964.                   ZOutTxt$(J) = MID$(ZOutTxt$, K + 1)
  965.                ELSE
  966.                   '*
  967.                   '* Keep the remaining part of the line and process
  968.                   '* it on the next pass
  969.                   '*
  970.                   I = I - 1
  971.                   ZOutTxt$(I) = MID$(ZOutTxt$, K + 1)
  972.                END IF
  973.                J = J + 1
  974.                EXIT DO
  975.             ELSEIF EndOfPara THEN
  976.                ZOutTxt$(J) = ZOutTxt$
  977.                J = J + 1
  978.                EXIT DO
  979.             END IF
  980.          LOOP
  981.       LOOP
  982.  
  983.       FOR I = J TO 99
  984.          ZOutTxt$(I) = BlankLine$
  985.       NEXT
  986.  
  987.       EndOfMsg = J - 1
  988.  
  989.       '*
  990.       '* Space out the text on each line
  991.       '*
  992.       IF Justify% THEN
  993.          FOR I = MsgLockLines + 1 TO EndOfMsg
  994.             CALL LastParaLine(I, EndOfMsg, EndOfPara)
  995.             IF NOT EndOfPara THEN
  996.                '*
  997.                '* Space out the line
  998.                '*
  999.                ZOutTxt$ = ZOutTxt$(I)
  1000.                CALL TrimTrail(ZOutTxt$, " ")
  1001.                TxtLen = LEN(ZOutTxt$)
  1002.                SpacesToAdd = ZRightMargin - TxtLen
  1003.                IF SpacesToAdd > 0 THEN
  1004.                   '*
  1005.                   '* Skip leading spaces on the line
  1006.                   '*
  1007.                   Place = 1
  1008.                   IF LEFT$(ZOutTxt$, 1) = " " THEN
  1009.                      CALL FindWord(ZOutTxt$, 1, Place)
  1010.                   END IF
  1011.                   '*
  1012.                   '* Find all of the possible places to space out the line
  1013.                   '*
  1014.                   NumPlaces = 0
  1015.                   DO WHILE 1
  1016.                      CALL FindWord(ZOutTxt$, 1, Place)
  1017.                      IF Place < TxtLen THEN
  1018.                         NumPlaces = NumPlaces + 1
  1019.                         Places(NumPlaces) = Place
  1020.                      ELSE
  1021.                         EXIT DO
  1022.                      END IF
  1023.                   LOOP
  1024.                   '*
  1025.                   '* Fill in available places with soft spaces
  1026.                   '*
  1027.                   IF NumPlaces <> 0 THEN
  1028.                      ExtraPlaces = (SpacesToAdd MOD NumPlaces)
  1029.                      LeftExtra = ExtraPlaces \ 2
  1030.                      RightExtra = ExtraPlaces - LeftExtra
  1031.                      FOR J = NumPlaces TO 1 STEP -1
  1032.                         SpacesThisPlace = SpacesToAdd \ NumPlaces
  1033.                         IF J <= LeftExtra OR J > NumPlaces - RightExtra THEN
  1034.                            SpacesThisPlace = SpacesThisPlace + 1
  1035.                         END IF
  1036.                         IF SpacesThisPlace <> 0 THEN
  1037.                            ZOutTxt$ = LEFT$(ZOutTxt$, Places(J) - 1) + STRING$(SpacesThisPlace, SoftSpace$) + MID$(ZOutTxt$, Places(J))
  1038.                         END IF
  1039.                      NEXT J
  1040.                   END IF
  1041.                END IF
  1042.                ZOutTxt$(I) = ZOutTxt$
  1043.             END IF
  1044.          NEXT I
  1045.       END IF
  1046.  
  1047.       CALL UpdateScreen
  1048.  
  1049.       END SUB
  1050.  
  1051. '*  SaveCursor()
  1052. '*----------------------------------------------------------------------------
  1053. '*  This routine saves the current cursor position
  1054. '*
  1055. '*
  1056. * ------[ first line different ]------
  1057.       SUB SaveCursor (Row%, Col%) STATIC
  1058.       Row% = CurrentRow
  1059.       Col% = CurrentCol
  1060.       END SUB
  1061.  
  1062. '*  UnGetChar()
  1063. '*----------------------------------------------------------------------------
  1064. '*   Puts a key in the beginning of the keyboard buffer
  1065. '*
  1066. '*
  1067.       SUB UnGetChar (X) STATIC
  1068.       ZCommportStack$ = CHR$(X) + ZCommportStack$
  1069.       END SUB
  1070.  
  1071. '*  UnString()
  1072. '*----------------------------------------------------------------------------
  1073. '*  Removes one string from another
  1074. '*
  1075. '*
  1076.       SUB UnString (YY$, BadString$) STATIC
  1077.       I = INSTR(YY$, BadString$)
  1078.       WHILE I <> 0
  1079.          YY$ = LEFT$(YY$, I - 1) + MID$(YY$, I + LEN(BadString$))
  1080.          I = INSTR(YY$, BadString$)
  1081.       WEND
  1082.       END SUB
  1083.  
  1084. '*  UpdateScreen()
  1085. '*----------------------------------------------------------------------------
  1086. '*  This is one of the most important routines  It compares the arrays
  1087. '*  ZOutTxt$ and ZWorkAra$ and only sends the user the DIFFERENCE between the
  1088. '*  two within the viewing area  In this way all processing can be done on
  1089. '*  ZOutTxt$ and then the screen is updated to reflect the changes. After the
  1090. '*  users screen is updated, ZWorkAra$ is changed to reflect what should be
  1091. '*  on the users' screen The cursor is restored to its original position
  1092. '*
  1093. '*
  1094.       SUB UpdateScreen STATIC
  1095. * REPLACING old line(s) by new
  1096. * ------[ first line different ]------
  1097. 3100  CALL SaveCursor(Row, Col)
  1098. IF ZExpertUser THEN PE = 24 _
  1099.    Else PE = 19
  1100.       For I = 3 To PE                'Pe 07/25/92
  1101.          Index = I + TopLine - 3
  1102.          ScreenLine$ = ZWorkAra$(I)
  1103.          MessageLine$ = ZOutTxt$(Index)
  1104.          LML = LEN(MessageLine$)
  1105.  
  1106.          IF Index = ZMaxMsgLines + 1 THEN
  1107.             CALL EraseToEOL(I, 1)
  1108.             CALL PutScreen("[* End of Message *]", CyanFore, ZFalse)
  1109.             ZWorkAra$(I) = CHR$(EndKey)
  1110.          ELSEIF Index > ZMaxMsgLines + 1 THEN
  1111.             IF ScreenLine$ <> BlankLine$ THEN
  1112.                CALL EraseToEOL(I, 1)
  1113.                ZWorkAra$(I) = BlankLine$
  1114.             END IF
  1115.          ELSEIF MessageLine$ = ScreenLine$ THEN
  1116.             '*
  1117.             '* Screen = What's in message buffer
  1118.             '*
  1119.          ELSEIF MessageLine$ = BlankLine$ OR MessageLine$ = SPACE$(LML) THEN
  1120.             CALL EraseToEOL(I, 1)
  1121.             ZWorkAra$(I) = MessageLine$
  1122.          ELSE
  1123.           CALL MoveCursor(I, 1)
  1124.           YY$ = MessageLine$
  1125.           CALL EraseToEOL(CurrentRow, CurrentCol) ' <-- Switched these 2 to
  1126.           CALL PutScreen(YY$, YellowFore, ZTrue)  ' <-- get P)aint Working
  1127.           ZWorkAra$(I) = ZOutTxt$(Index)          '     Properly.
  1128.          END IF
  1129.       NEXT I
  1130.     CALL MoveCursor(Row,Col)
  1131.       END SUB
  1132.  
  1133. '*  UpdateStatusLine()
  1134. '*-----------------------------------------------------------------------------
  1135. '*  Rewrites the status line on screen line(s) 1 and 2
  1136. '*
  1137. '*    Input:  How% = 1   - Rewrite both lines
  1138. '*            How% = 2   - Just rewrite top line
  1139. ' Changed this a little bit.
  1140. ' Changed the DOUBLE ESC command to CTRL-K (Double ESC still works)
  1141. ' CTRL-K was easier to explain to brain dead users :)
  1142. ' Also attempted to make CTRL-K stand out a bit more
  1143. '
  1144.  
  1145.       SUB UpdateStatusLine (How%) STATIC
  1146. * REPLACING old line(s) by new
  1147. * ------[ first line different ]------
  1148. 3200  CALL MoveCursor(1, 1)
  1149.       CALL PutScreen("ANSIED " + Version$ +" by Tom Collins       ", BlueFore, ZTrue)
  1150.       CALL PutScreen("Hit Esc Twice or Cntrl-K ",RedFore, ZTrue)
  1151.       CALL PutScreen("for Menu" + SPACE$(24),BlueFore, ZTrue)
  1152.  
  1153. * REPLACING old line(s) by new
  1154. 3210  IF How% = 1 THEN
  1155.          YY$ = CHR$(205) + " To: " + MsgTo$ + " " + CHR$(205) + " Re: " + MsgSubj$ + " " + CHR$(205)
  1156. * ------[ first line different ]------
  1157.          YY$ = YY$ + STRING$(74 - LEN(YY$), CHR$(205))
  1158.          IF InsertMode THEN
  1159.             MID$(YY$, 70) = " Ins "
  1160.          ELSE
  1161.             MID$(YY$, 70) = " Ovw "
  1162.          END IF
  1163.          I = 1
  1164.          CALL MoveCursor(2, I)
  1165.          CALL PutScreen(YY$, WhiteFore, ZFalse)
  1166.       END IF
  1167.       END SUB
  1168.  
  1169. * INSERTING new line(s)
  1170. 3220 SUB DisplayKeys STATIC
  1171. IF ZExpertUser THEN EXIT SUB   'Pe 07/25/92
  1172.   CALL MoveCursor(20,1)
  1173. YY$ = STRING$(79,CHR$(205))
  1174. MID$ (YY$,30) = "ANSIED QuickKeys Menu"
  1175.   CALL Putscreen(YY$,RedFore,DefaultBold)
  1176.   CALL MoveCursor(21,1)
  1177.   CALL PutScreen ("^A Word Left  ^B Reformat  ^C PageDown  ^D ColRight ^E LineUp   ^F Word Right",DefaultColor, DefaultBold)
  1178.   CALL MoveCursor(22,1)
  1179.   CALL PutScreen ("^G Del        ^O Reflow    ^P Repaint   ^R PageUp   ^S ColLeft  ^T DelWordRight",DefaultColor, DefaultBold)
  1180.   CALL MoveCursor(23,1)
  1181.   CALL PutScreen ("^V Toggle Ins ^W home      ^X Line Down ^Y Del Line ^Z End",DefaultColor, DefaultBold)
  1182.   CALL MoveCursor(24,1)
  1183.   CALL PutScreen ("^K Lists Menu",GreenFore, DefaultBold)
  1184.  
  1185.      END SUB
  1186.